Skip to content

feat: add principals flag to cli for ssh dynamic secrets#238

Merged
saifsmailbox98 merged 3 commits into
mainfrom
saif/secrets-296-add-principals-flag-to-cli-for-ssh-dynamic-secrets
May 20, 2026
Merged

feat: add principals flag to cli for ssh dynamic secrets#238
saifsmailbox98 merged 3 commits into
mainfrom
saif/secrets-296-add-principals-flag-to-cli-for-ssh-dynamic-secrets

Conversation

@saifsmailbox98
Copy link
Copy Markdown
Contributor

Description 📣

Adds a --principals flag to infisical dynamic-secrets lease create so users can specify which principals to include in SSH dynamic secret leases. Also adds principals support to the agent dynamicSecret template function as an optional 6th argument.

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

@linear
Copy link
Copy Markdown

linear Bot commented May 18, 2026

SECRETS-296

@infisical-review-police
Copy link
Copy Markdown

💬 Discussion in Slack: #pr-review-cli-238-feat-add-principals-flag-to-cli-for-ssh-dynamic-secrets

Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel.

Comment thread packages/cmd/agent.go
Comment thread packages/cmd/agent.go
@saifsmailbox98 saifsmailbox98 requested a review from adilsitos May 19, 2026 00:26
Comment thread packages/cmd/agent.go Outdated
Comment thread packages/cmd/agent.go
dynamicSecretManager.RegisterTemplateUnsafe(projectSlug, envSlug, secretPath, slug, templateId, ttl, principals)

etagData := fmt.Sprintf("%s-%s-%s-%s-%s", projectSlug, envSlug, secretPath, slug, ttl)
etagData := fmt.Sprintf("%s-%s-%s-%s-%s-%s", projectSlug, envSlug, secretPath, slug, ttl, principals)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for the cache we won't have a problem if the principals are different, but can't this be a problem on the etag as well? if they change the order of the principals, this would cause a difference an we would write on disk the change (which in case wouldn't really be a change, since only the order was changed)

Not sure if this is a problem, I just wanted to raise this so we can discuss.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be fine because if a new lease was issued, then we should probably put that in the file rather than having the old one. The old one would expire on its own by the TTL.

And this should only happen if somebody is manually updating the template and the principal order, so it looks like they deliberately want that.

Comment thread packages/cmd/agent.go
@saifsmailbox98 saifsmailbox98 merged commit b193c99 into main May 20, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants